$("#returnPage").click(function(){
	$(window).attr('location',"../page/login.html");
});

var perfix = "http://localhost:8080";

// --------- 提交注册 ---------
$("#commitBtn").on('click',function(){
	var username = $("#username").val();
	var password = $("#password").val();
	var model = {
		"username":username,
		"password":password,
		"userImg":"http://qpuevq2yq.hn-bkt.clouddn.com/bg-pic.png"
	}
	$.ajax({
		url: perfix + '/user/register',
		data: JSON.stringify(model),
		type: 'post',
		contentType:'application/json',
		success:function(data){
			if(data.code != 200){
				alert(data.message)
			}else{
				$(window).attr('location',"../page/login.html");
			}
		}
	})
})
// --------- 提交注册 ---------